/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.sys.entity;

import org.hibernate.validator.constraints.Length;

import com.thinkgem.jeesite.common.persistence.DataEntity;

/**
 * 授权日志Entity
 * @author fanqinglong
 * @version 2018-06-06
 */
public class SecurityLog extends DataEntity<SecurityLog> {
	
	private static final long serialVersionUID = 1L;
	private String module;		// 操作的模块（用户、角色）
	private String moduleId;		// 模块的id
	private String moduleName;		// 模块名称
	private String type;		// type
	private String data;		// data
	
	private String dateFrom;    // 日期起始
	private String dateTo;      // 日期结束
	
	public String getDateFrom() {
		return dateFrom;
	}

	public void setDateFrom(String dateFrom) {
		this.dateFrom = dateFrom;
	}

	public String getDateTo() {
		return dateTo;
	}

	public void setDateTo(String dateTo) {
		this.dateTo = dateTo;
	}

	/**
	 * 操作模块：用户
	 */
	public final static String MODULE_USER = "1";
	/**
	 * 操作模块：角色
	 */
	public final static String MODULE_ROLE = "2";
	
	
	/**
	 * 操作：新增用户
	 */
	public final static String TYPE_INSERT = "1";
	/**
	 * 操作：禁用用户
	 */
	public final static String TYPE_DISABLE = "2";
	/**
	 * 操作：给角色赋予权限
	 */
	public final static String TYPE_GIVE = "3";
	/**
	 * 操作：给角色分配用户
	 */
	public final static String TYPE_ASSIGN = "4";
	/**
	 * 操作：给用户赋予角色
	 */
	public final static String TYPE_GIVE_ROLE = "5";
	
	
	public SecurityLog() {
		super();
	}

	public SecurityLog(String id){
		super(id);
	}

	public SecurityLog(String module,String moduleId,String moduleName,String type,String data){
		this.module = module;
		this.moduleId = moduleId;
		this.moduleName = moduleName;
		this.type = type;
		this.data = data;
	}
	
	@Length(min=0, max=64, message="操作的模块（用户、角色）长度必须介于 0 和 64 之间")
	public String getModule() {
		return module;
	}

	public void setModule(String module) {
		this.module = module;
	}
	
	@Length(min=0, max=64, message="模块的id长度必须介于 0 和 64 之间")
	public String getModuleId() {
		return moduleId;
	}

	public void setModuleId(String moduleId) {
		this.moduleId = moduleId;
	}
	
	@Length(min=0, max=64, message="模块名称长度必须介于 0 和 64 之间")
	public String getModuleName() {
		return moduleName;
	}

	public void setModuleName(String moduleName) {
		this.moduleName = moduleName;
	}
	
	@Length(min=0, max=10, message="type长度必须介于 0 和 10 之间")
	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}
	
	public String getData() {
		return data;
	}

	public void setData(String data) {
		this.data = data;
	}
	
}